﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Dict.DataModel;


namespace Dict.Blo
{
    public class DictTreasureSkillBlo
    {
        public static TableTreasureSkill GetTableTreasureSkill(string treasureId, int quality)
        {
            List<TableTreasureSkill> list = Dict.DictDataManager.Instance.tableTreasureSkillDao.GetByTwoIndex(treasureId, quality.ToString());
            if (list.Count > 0)
            {
                return list[0];
            }
            return null;
        }

        public static List<TableTreasureSkill> GetTableTreasureSkillsAttribute(string treasureId, int quality)
        {
            List<TableTreasureSkill> ttss = new List<TableTreasureSkill>();
            for(int i = 0; i <= quality;++i)
            {
                List<TableTreasureSkill> list = Dict.DictDataManager.Instance.tableTreasureSkillDao.GetByTwoIndex(treasureId, i.ToString());
                ttss.AddRange(list);
            }
            return ttss;
        }
    }
}